# !ResEd Misc CSE Makefile

# ****** EDIT MAKEPROTO, NOT MAKEFILE ******
# Then construct Makefile using "amu -f MakeProto depend"

# PROGDIR should be set to the application installation directory

# Can set:
#  CFLAGS     -  additional cc options
#  INCLUDES   -  locations to search for "included" files
#  AFLAGS     -  additional objasm options
#  LDFLAGS    -  additional link options

INCLUDES = -I^.^.common

CPFLAGS = A~C~DF~L~N~P~Q~R~S~T~V

LIBS = ^.^.common.o.commonlib C:o.Stubs

CFILES = colours.c gui.c main.c objdefs.c object.c objedit.c protocol.c relocate.c help.c

OFILES = colours.o gui.o main.o objdefs.o object.o objedit.o protocol.o relocate.o help.o

FILES = !Config !Help !Icons !Icons22 !Palette !Run !RunImage Messages Templates

all: !RunImage
        @echo *** Misc build complete

!RunImage: $(OFILES) ^.^.common.o.commonlib
        cc -c $(CFLAGS) $(INCLUDES) -o ^.^.common.o.version ^.^.common.c.version
        link $(LDFLAGS) -o $@ $(OFILES) ^.^.common.o.version $(LIBS)
        squeeze $@

^.^.common.o.commonlib:
        dir ^.^.common
        amu o.commonlib
        dir ^.CSE.!Misc

h.icondefs: Templates
        ^.^.^.!WinEdit -h Templates > h.icondefs

.c.o:
        cc -c $(CFLAGS) $(INCLUDES) -o $@ $<

.s.o:
        objasm -quit -CloseExec $(AFLAGS) -from $< -to $@

install: $(FILES)
        copy !Config $(PROGDIR).!Config $(CPFLAGS)
        copy !Help $(PROGDIR).!Help $(CPFLAGS)
        copy !Icons $(PROGDIR).!Icons $(CPFLAGS)
        copy !Icons22 $(PROGDIR).!Icons22 $(CPFLAGS)
        copy !Palette $(PROGDIR).!Palette $(CPFLAGS)
        copy !Run $(PROGDIR).!Run $(CPFLAGS)
        copy !RunImage $(PROGDIR).!RunImage $(CPFLAGS)
        copy Messages $(PROGDIR).Messages $(CPFLAGS)
        copy Templates $(PROGDIR).Templates $(CPFLAGS)
        @echo *** Misc installation complete

depend:
        copy MakeProto Makefile1 $(CPFLAGS)
        cc -c -M $(INCLUDES) $(CFILES) >> Makefile1
        remove Makefile0
        -rename Makefile Makefile0
        rename Makefile1 Makefile
        @echo *** Misc dependencies established

clean:
       create o.foo
       wipe o.* ~CRF~V
       remove !RunImage
       remove h.icondefs
       @echo *** Misc cleaned

# Dependencies following this line provided by make depend

o.colours:	c.colours
o.colours:	^.^.common.h.resed
o.colours:	^.^.common.h.message
o.colours:	^.^.common.h.error
o.colours:	^.^.common.h.debug
o.colours:	^.^.common.h.dbmalloc
o.colours:	h.main
o.colours:	^.^.common.h.swicall
o.colours:	^.^.common.h.wimp
o.colours:	^.^.common.h.menu
o.colours:	h.colours
o.colours:	h.gui
o.gui:	c.gui
o.gui:	^.^.common.h.resed
o.gui:	^.^.common.h.message
o.gui:	^.^.common.h.error
o.gui:	^.^.common.h.debug
o.gui:	^.^.common.h.dbmalloc
o.gui:	h.main
o.gui:	^.^.common.h.swicall
o.gui:	^.^.common.h.wimp
o.gui:	^.^.common.h.dbox
o.gui:	h.colours
o.gui:	h.gui
o.main:	c.main
o.main:	^.^.common.h.resed
o.main:	^.^.common.h.message
o.main:	^.^.common.h.error
o.main:	^.^.common.h.debug
o.main:	^.^.common.h.dbmalloc
o.main:	h.main
o.main:	^.^.common.h.swicall
o.main:	^.^.common.h.wimp
o.main:	^.^.common.h.resformat
o.main:	^.^.common.h.newmsgs
o.main:	^.^.common.h.interactor
o.main:	^.^.common.h.registry
o.main:	h.format
o.main:	h.relocate
o.main:	h.help
o.main:	h.objedit
o.main:	h.objdefs
o.main:	h.object
o.main:	h.protocol
o.objdefs:	c.objdefs
o.objdefs:	^.^.common.h.resed
o.objdefs:	^.^.common.h.message
o.objdefs:	^.^.common.h.error
o.objdefs:	^.^.common.h.debug
o.objdefs:	^.^.common.h.dbmalloc
o.objdefs:	h.main
o.objdefs:	^.^.common.h.wimp
o.objdefs:	^.^.common.h.resformat
o.objdefs:	^.^.common.h.newmsgs
o.objdefs:	h.format
o.objdefs:	h.relocate
o.objdefs:	h.objedit
o.objdefs:	h.colours
o.objdefs:	h.icondefs
o.objdefs:	h.objdefs
o.objdefs:	h.object
o.object:	c.object
o.object:	^.^.common.h.resed
o.object:	^.^.common.h.message
o.object:	^.^.common.h.error
o.object:	^.^.common.h.debug
o.object:	^.^.common.h.dbmalloc
o.object:	h.main
o.object:	^.^.common.h.swicall
o.object:	^.^.common.h.wimp
o.object:	^.^.common.h.resformat
o.object:	^.^.common.h.newmsgs
o.object:	^.^.common.h.dbox
o.object:	^.^.common.h.interactor
o.object:	^.^.common.h.menu
o.object:	^.^.common.h.registry
o.object:	h.format
o.object:	h.relocate
o.object:	h.objedit
o.object:	h.colours
o.object:	h.objdefs
o.object:	h.object
o.object:	h.gui
o.object:	h.icondefs
o.object:	h.protocol
o.objedit:	c.objedit
o.objedit:	^.^.common.h.resed
o.objedit:	^.^.common.h.message
o.objedit:	^.^.common.h.error
o.objedit:	^.^.common.h.debug
o.objedit:	^.^.common.h.dbmalloc
o.objedit:	h.main
o.objedit:	^.^.common.h.swicall
o.objedit:	^.^.common.h.wimp
o.objedit:	^.^.common.h.resformat
o.objedit:	^.^.common.h.newmsgs
o.objedit:	h.format
o.objedit:	h.relocate
o.objedit:	h.objedit
o.objedit:	h.object
o.objedit:	h.protocol
o.protocol:	c.protocol
o.protocol:	^.^.common.h.resed
o.protocol:	^.^.common.h.message
o.protocol:	^.^.common.h.error
o.protocol:	^.^.common.h.debug
o.protocol:	^.^.common.h.dbmalloc
o.protocol:	h.main
o.protocol:	^.^.common.h.swicall
o.protocol:	^.^.common.h.wimp
o.protocol:	^.^.common.h.resformat
o.protocol:	^.^.common.h.newmsgs
o.protocol:	^.^.common.h.registry
o.protocol:	h.format
o.protocol:	h.relocate
o.protocol:	h.objedit
o.protocol:	h.object
o.protocol:	h.protocol
o.relocate:	c.relocate
o.relocate:	^.^.common.h.resed
o.relocate:	^.^.common.h.message
o.relocate:	^.^.common.h.error
o.relocate:	^.^.common.h.debug
o.relocate:	^.^.common.h.dbmalloc
o.relocate:	h.main
o.relocate:	^.^.common.h.resformat
o.relocate:	h.relocate
o.help:	c.help
o.help:	^.^.common.h.resed
o.help:	^.^.common.h.message
o.help:	^.^.common.h.error
o.help:	^.^.common.h.debug
o.help:	^.^.common.h.dbmalloc
o.help:	h.main
o.help:	^.^.common.h.swicall
o.help:	^.^.common.h.wimp
o.help:	^.^.common.h.resformat
o.help:	^.^.common.h.newmsgs
o.help:	^.^.common.h.menu
o.help:	^.^.common.h.registry
o.help:	h.format
o.help:	h.relocate
o.help:	h.objedit
o.help:	h.object
o.help:	h.help
